home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / ebl407px.zip / BATDEMO.BAT < prev    next >
DOS Batch File  |  1992-01-24  |  18KB  |  579 lines

  1. bat * Loading DEMO .....
  2. *           Written by F.Canova 10/5/83 through 01/25/90
  3. *   (c) Copyright 1983-1990 by Seaware Corp. all rights reserved.
  4. *    This batch file REQUIRES EBL PLUS for proper execution!
  5.  
  6. ********************* NOTE! NOTE! NOTE! NOTE! ********************
  7. %D = 'RAM'    |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
  8. goto -start
  9. * For more information or to receive your own copy of EBL PLUS write to:
  10. *              Seaware Corp.
  11. *              P.O. Box 1656
  12. *              Delray Beach, FL 33444
  13.  
  14. *---- FEATURES OF THE LANGUAGE USED WITHIN THIS DEMO ARE: ----------------
  15. * Standard DOS commands can be intermixed freely with BAT commands.
  16. * Up to 255 chars are allowed for labels, contents of vars, and literals
  17. * 10 variables are provided to be passed to/from DOS. They're %0 to %9.
  18. * 15 variables are provided for EBL PLUS┐ user use only. They're %A to %O.
  19. * The variable %R is a return code that any routine can set at [0:04FE]
  20. * BEGTYPE command can have screen attributes via the COLORCHAR command,
  21. * or the '\hex' format.
  22. * BEGSTACK command can have timing attributes via the KEY(PAUSE) or
  23. * the alternative '\hex' format.
  24. * Spaces are not needed to delimit operators.
  25. * Non-spaces will concatenate variables and literals.
  26. * EXIST() and DIR() set a return code based on state of a file's existence.
  27.  
  28.         ** Now actually do the bouncing bar menu **
  29. -End1    type " Exit to DOS                " | If %A = Enter then goto -Bye
  30. -Endit    %A = select( color( yellow on green), color( black on white ), Arrow)
  31.     if %A = Esc then goto -Bye
  32.     if %R = 1 then goto -End1
  33. -End2    if %R = 2 type " Go to on-line documentation" | If %A = Enter then stack "BATDOC" |exit
  34. -End3    if %R = 3 type " Return to EBL Plus demo    " | If %A = Enter then goto -top
  35.        goto -endit
  36.  
  37. -Bye    window( 19, 14, 49, 21)
  38.     type "So long" %F....
  39.     type "P.S. For quickie help,"
  40.     type " just enter 'BAT' from DOS!"
  41.     exit
  42.  
  43. -start
  44.     if %D = 'RAM' then RAM
  45.     else BIOS
  46.  
  47. ** Open the demo with welcome message windows in the shape of a big 'W' **
  48. *   play( o5 t140 ms l8 g4 p >c <b >c p6 <e p6 d p6 b p6 >c..)
  49. *   repeat with %0 = 1 to 27
  50. *    color ((%0 % 8) & "F")
  51. *    if %0 < 7        then %1 = %0 * 2
  52. *       else if %0 < 14  then %1 = (14 - %0) * 2
  53. *       else if %0 < 21  then %1 = (%0 - 13) * 2
  54. *       else          %1 = (28 - %0) * 2
  55. *    window( (%0*2), %1, (%0*2+20), (%1+5), s)
  56. *    type
  57. *    type center("Welcome", 18)
  58. *   end repeat
  59. *   wait until time(2)
  60.  
  61. ** Start by asking who I'm talking to **
  62.     colorchar '=' as color( yellow on white )
  63.     colorchar '@' as color( white on blue )
  64.     colorchar '`' as color( blink white on blue )
  65.     color( black on white )
  66.     cls
  67.     begtype
  68.           =(Non-IBM systems, read NOTE within this file)=
  69.  
  70.   @┌───────────────────────────────────────────────────────────────────────┐@
  71.   @│          EXTENDED BATCH LANGUAGE-PLUS                   │@
  72.   @│                                       │@
  73.   @│    Welcome to the Extended Batch Language Plus Demonstration !       │@
  74.   @│                                       │@
  75.   @└───────────────────────────────────────────────────────────────────────┘@
  76. end
  77. call -asplogo 40 16
  78. color( white on black )
  79. locate 13 10 | Type "What is your first name? ;"
  80. read %F
  81. %7 = 27
  82. %L =
  83. %0 = left( (" " & %F & "'s EBL Plus Sampler Menu"), 47)
  84.  
  85. -top ** Show Master Menu of things that can be shown **
  86.     color( Normal )
  87.     colorchar
  88.     colorchar '@' as color( white on blue )
  89.     colorchar '^' as color( lgray on blue )
  90.     colorchar '#' as color( black on cyan )
  91.     colorchar '&' as color( yellow on red )
  92.     colorchar '*' as color( white on red )
  93.     locate 1 1
  94.     cls begtype
  95. @════════════════════════════════════════════════@ ^┌─────────────────────────┐^
  96. @ \%0@ ^│ User supported software │^
  97. @════════════════════════════════════════════════@ ^│           by          │^
  98.                            ^│                  │^
  99.                            ^│ Seaware Corp.          │^
  100.  # S #────&Display Screen and String operations  & ^│ P.O. Box 1656          │^
  101.       *                     * ^│ Delray Beach, FL 33444  │^
  102.  # D #────&Directory of available programs     & ^│ 407/738-1712          │^
  103.       *                     * ^│                  │^
  104.  # F #────&Testing for Files             & ^│ Order your registered   │^
  105.       *                     * ^│ copy for $79 from us    │^
  106.  # K #────&Keyboard stack (the invisible fingers)& ^│ directly or our order   │^
  107.       *                     * ^│ line at 800/634-8188    │^
  108.  # C #────&I can Count                 & ^│                  │^
  109.       *                     * ^│ Please copy and share   │^
  110.  # X #────&eXit                  & ^│ BAT.COM, BATDOC.BAT,    │^
  111.                            ^│ and BATDEMO.BAT for     │^
  112.                            ^│ non-commercial uses     │^
  113.                            ^│ only.              │^
  114.                            ^│                  │^
  115.                            ^│ ASP member.          │^
  116. (Select a demo with the cursor and press ─┘)       ^└─────────────────────────┘^
  117. end
  118.     colorchar
  119.     colorchar '@' as color( white on blue )
  120. -Entry
  121.     color( yellow on black)
  122.     %9 = ''
  123.  
  124. -Text.1 *** (C)ount
  125.     locate 1 18
  126.     type " See how EBL Plus makes your screen come alive"
  127.     type " with color and powerful string handling.     "
  128.     if %9 = Enter then call -sgo | goto -top
  129.  
  130. -Choose
  131.     %7 = %7 + 3
  132.     %9 = select(color(yellow on red),color(black on white),Arrow)
  133.  
  134.     if %9 = 'C' then %9 = Enter
  135.     if %9 = 'D' then %9 = Enter
  136.     if %9 = 'F' then %9 = Enter
  137.     if %9 = 'K' then %9 = Enter
  138.     if %9 = 'S' then %9 = Enter
  139.     if %9 = 'X' then %9 = Enter
  140.     locate 1 18
  141.     if %R = 1 then goto -Text.1
  142.     if %R <> 2 then skip 4
  143.     type " See how EBL Plus can work together with your "
  144.     type " application and DOS.                         "
  145.     if %9 = Enter then call -dgo | goto -top
  146.           else goto -Choose
  147.     if %R <> 3 then skip 4
  148.     type " EBL Plus can see files that are created by   "
  149.     type " your programs, or create new ones on it own. "
  150.     if %9 = Enter then call -fgo | goto -top
  151.           else goto -Choose
  152.     if %R <> 4 then skip 4
  153.     type " EBL Plus can automatically control your      "
  154.     type " applications by typing on the keyboard.      "
  155.     if %9 = Enter then call -kgo | goto -top
  156.           else goto -Choose
  157.     if %R <> 5 then skip 4
  158.     type " This is a simple game that shows the math    "
  159.     type " and looping capabilities of EBL Plus.        "
  160.     if %9 = Enter then call -i.can.count | goto -top
  161.           else goto -Choose
  162.     else
  163.     type " Leave this Demo and return to DOS            "
  164.     type "                                              "
  165.     if %9 = Enter then goto -exit
  166.           else goto -Choose
  167.  
  168. *******************************************************************************
  169.  
  170. * number guessing demo *
  171. -i.can.count
  172.     cls type "I am thinking of a two digit number, can you guess it?"
  173.     %J=tries
  174.     %7 = right(%7,2) + 0        |* Limit to just 2 digits!
  175.     repeat with %A = 4 down to 0
  176.     read %5
  177.     if %5 = %7
  178.     begin
  179.         type "Great!  I was afraid you weren't going to get it!"
  180.         exit repeat
  181.     end
  182.     if %A = 1 then %J = try
  183.     if %A = 0
  184.     begin
  185.         type "BOO HISSS!  The number was" %7 "!"
  186.         exit repeat
  187.     end
  188.     if %5 > %7 type "Try a little lower.  You get" %A "more" %J.
  189.     if %5 < %7 type "Try a higher number.  You get" %A "more" %J.
  190.     end repeat
  191.     begtype
  192. @════════════════════════════════════════════════════════════════════════════@
  193.   A BAT program can create loops and count events.  With this you can
  194.   sequence through file numbers, or create loops to do retries in case of
  195.   errors.  The REPEAT commands are handy for this.  EBL programs can even
  196.   do arithmetic (up to 18 digits) and string manipulation (up to 255
  197.   characters mixed case).
  198. @════════════════════════════════════════════════════════════════════════════@
  199.  
  200. Press any key to continue. . .
  201.  
  202. end
  203. inkey
  204. return
  205.  
  206. *******************************************************************************
  207.  
  208. * directory demo *
  209. -dgo
  210.     color( White )
  211.     cls
  212.     type "Enter file.spec for files you would like to see,"
  213.     read or press ENTER for all: %1
  214.     if .%1 = '.' then %1 = '*.*'
  215.     -dirques
  216.     colorchar . as color( yellow on black )
  217.     type "Would you like a .S.tandard or .W.ide directory?"
  218.     select( color(yellow on black))
  219.     colorchar .
  220.     if %R = 2 then %3 = '/w'
  221.        else %3 =
  222.     cls
  223.     type "EBL Plus can work directly with your applications or DOS."
  224.     type "For example, two values are passed to DOS